home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_018 / ash / readme < prev    next >
Text File  |  1992-05-06  |  9KB  |  252 lines

  1. This program is a prerelease version for a future AMIGA product that
  2. will someday emulate the major capabilities for the UNIX* C-Shell.
  3.  
  4. This program is NOT yet a Computerverse product!!
  5. Computerverse will not assume any responsibility for its use.
  6. This version is only for betasite testing and examination, and is
  7. prone to stack crashes as most prereleases are.
  8. This is not a "port" from anything at all, with no cross-testing.
  9. Please be sure to examine the "known bugs" section at the end.
  10.  
  11. Due to a 32K size constraint, this program does not have FULL csh
  12. emulation capability. This version does NOT have pipes, job control,
  13. or filename expansion other than what amigados provides.
  14.  
  15. Multiple commands per line are delimited by a semicolon (;).
  16. Both single and double quotes are parsed last, and can be used
  17. to group command arguments. a "#" character delimits comments.
  18. EOF is (CTRL-ALT-minus(on the keypad)).
  19. Tabstops are programmable and can be backspaced.
  20. The "del" key will delete the current line.
  21.  
  22. EXPRESSIONS:
  23.  
  24. The ASH has a built-in expression evaulator that can perform
  25. mixed string, numeric, and boolean operations. Your best bet
  26. is to experiment for awhile with the following operators:
  27.  
  28.     operator       type     associativity  what?
  29.     ()             any       -->           Infix parenthetic op
  30.     !              bool      <--           logical uniary "not"
  31.     * / %          numeric   <--           multiply,divide,mod
  32.     + -            numeric   <--           addition,subtraction
  33.     < <= > >=      string    <--           comparison
  34.     == !=          string    <--           equal, different
  35.     &&             bool      <--           logical "and"
  36.     ||             bool      <--           logical "or"
  37.     =              any       <--           assignment
  38.     ,              any       -->           seperator
  39.  
  40. There is a known bug with unary "-", please bypass by using "0-e".
  41.  
  42.  
  43. INTRINSIC COMMANDS:
  44.  
  45. if    expression
  46. (statements)
  47. else
  48. (statements)
  49. endif
  50.  
  51.     The if/else/endif group will execute the enclosed    statements
  52.     if the expression is a logical "true".    the optional "else"
  53.     instruction flips the logical state.
  54.  
  55. while expression
  56. (statements)
  57. break
  58. continue
  59. end
  60.  
  61.     The while/break/continue/end group will execute the
  62.     statements as long as the expression is "true". The break
  63.     statement will force the loop to end immediatly. the
  64.     "continue" statement will force to loop to go back to the
  65.     while statement. The "end" statement will cause the loop to
  66.     go back to the while statement and reevaulate, if the while
  67.     expression is false, control will branch to the statement
  68.     following end.
  69.  
  70. foreach varible expression expression expression expression ...
  71. (statements)
  72. break
  73. continue
  74. end
  75.  
  76.     The foreach statement will loop once each expression in the
  77.     list and also assign the result of the expression to the
  78.     defined varible name. "break", "continue", and "end" are the
  79.     same as for the while group.
  80.  
  81. repeat n statement
  82.  
  83.     The repeat instruction will execute the statement following
  84.     it on the same line n times.
  85.  
  86. goto n
  87.  
  88.     The goto instruction will branch to prompt #n and continue
  89.     execution.
  90.  
  91. test expression "then" statements
  92.  
  93.     The test statement will execute the statement-list if the
  94.     expression is "true". It differs from the if statement in
  95.     that only the statement list after the seperator "then" are
  96.     executed once. no "endif" is required.
  97.  
  98. exit
  99.  
  100.     The exit statement terminates the CLI. The commands in the
  101.     file ".ashexit" are executed if the file exists.
  102.  
  103. set value="expression"
  104.  
  105.     The set command is used to assign varibles to values. Some
  106.     symbol names are reserved by the ASH itself and are as follows:
  107.         tabstop   The number of columns for tab expansion.
  108.         baud      The baud rate for the built-in terminal emulator.
  109.         status    The return code of the previous command.
  110.         $.prompt  The prompt string for ASH.
  111.         $h        The current history number.
  112.         $level    The current "level" of "if","while","foreach".            To display the curretly set varibles, type just "set". 
  113.     To display the "hidden" set varibles used internally,
  114.     type set -a. Once a varible is set, it can be accessed by
  115.     preceeding it with a "$". a "$#" prefix will return "true"
  116.     if the varible exists. Subscripting is also allowed as
  117.     $label[n]; here are some examples:
  118.         set a="1", b="a b c";echo $a,$b[2]
  119.  
  120. alias fakename "command"
  121.  
  122.     The "alias" command are similar to set, but are referenced
  123.     differently, they do not need a preceeding "$" but do need
  124.     to be defined in column 1 on the input line. aliases are
  125.     used for command substitution. Argument passing is done by
  126.     "$n" to pass argument number n. using "$*" will pass all
  127.     arguments.
  128.  
  129. unset label
  130. unalias label
  131.  
  132.     These commands are used to undefine any previous definations.
  133.  
  134. history
  135.  
  136.     The "history" command displays the last (currently 46)
  137.     commands in the "history loop". History substitutions can be
  138.     performed by using "!n", where n is the prompt number. "!!"
  139.     is the last command, indexing is also allowed as "!n[m]",
  140.     "!n$" or "!$" will return the last field of the referenced
  141.     prompt line.
  142.  
  143. source file arg1 arg2 arg3 ...
  144.  
  145.     The source command will execute commands from the given file.
  146.     Currently, sources should not be nested more than twice.
  147.     Arguments given to source will be referenced in the source
  148.     file as $0,$1,$2,$3,...
  149.     When the ASH starts-up it will automatically source the file
  150.     .ashinit and upon exit it will source .ashexit.
  151.     The arguments given to ASH (i.e. targv[]) will be passed to
  152.     the terminal sourcing as $1 $2 $3 just as arguments are
  153.     passed to a source file. If ASH is invoked with just a
  154.     single argument, it will just source that one file without
  155.     ".ashinit" or ".ashexit".
  156.  
  157. cat    -options file1 file2 ...
  158.  
  159.     The cat command is similar to the "type" command except that
  160.     it is intrinsic. The followiing options may be given:
  161.         -h display a header for each file.
  162.         -m display in interactive (more) mode, with page stops.
  163.         -s display all non-printing characters in hex.
  164.     BUGS: This command is much slower than "type".
  165.     cat -s sometimes crashes with large binaries, use "type opt h"
  166.  
  167. echo    -n expression expression ...
  168.  
  169.     The echo command prints the list of expressions. If given
  170.     the -n flag, no carrige return will be printed at the end.
  171.  
  172. eval expression,expression ...
  173.  
  174.     The eval command will evaulate the expression and print the
  175.     result. typing "echo 2*3" will print "2*3"; typing eval
  176.     "2*3" will print "6".
  177.  
  178. # comment
  179.     The "#" is used to seperate comments and could also be
  180.     classified as a command
  181.  
  182. clear
  183.     "clear" sends a control-L to the screen, which clears it.
  184.  
  185. beep
  186.     "beep" sends a control-G to the screen, which "blinks" it.
  187.  
  188. remote filename
  189.  
  190.     This is the built-in terminal emulator. If a file is given
  191.     then capturing will go to the file. capturing is initially
  192.     off, typing a "control-x" will flip its status. To exit from
  193.     remote, type a control-shift-minus(on the right keypad).
  194.  
  195. help
  196.  
  197.     The help command will show a listing of the currently
  198.     implemented intrinsic commands.
  199.  
  200. reset
  201.  
  202.     turns off the 8'th bit if your output to the screen is garbled
  203.  
  204. gets    varible
  205.  
  206.     The "gets" command will pause and wait for the user to enter
  207.     a string; the varible mentioned will be then set to the
  208.     entered string.
  209.  
  210.  
  211.  
  212.  
  213.  
  214. KNOWN BUGS:
  215.  
  216. 1) The flow control stuff ("while","foreach","continue","break","end")
  217. dont like con: input. Foreach currently does not like to be nested.
  218. Also, remember to pair while/foreach with end, if with endif;
  219. and not vice-versa.
  220.  
  221. 2) sorry, pipes and IO redirection and job control are not in this
  222. release, although the parser knows about them. IO redirection is
  223. currently only what the amigados "Execute" call gives you.
  224.  
  225. 3) The "cat" intrinsic is unacceptably slow. cat -s hates binaries.
  226.  
  227. 4) the "remote" (terminal emulator) prefers to capture files in ram:
  228.    "remote" needs some "time tweeking"
  229.  
  230. 5) "goto" does not work right, you should avoid goto's anyway.
  231.  
  232. 6) "history" prefers "!n[$]" instead of "!n$". please dont ask why.
  233.  
  234. 7) weird noise from the memory allocator/deallocator.
  235.  
  236. 8) too bad "WaitForChar" doesn't know about the ser: device.
  237.  
  238. 9) "source" crashes after >2 levels, it needs a lot of stack space.
  239.  
  240. 10) I'm working on the filename expansions goodies ASAP;
  241.     for now use the Amiga's format (you have to quote the '#').
  242.  
  243. 11) You cannot break out of a while/foreach loop until I get
  244.     info on signals. My "WaitForChar" kludge currently loses bytes.
  245.  
  246. Hopefully, I will have these bugs fixed before you are reading 
  247. this memo; I have decided to "shipit" today as-is, for a "free preview".
  248. If you have any ideas, comments, or know where I can get a hold
  249. of ANY documentation to fix the bugs, then please contact me at
  250. Computerverse.
  251. Thorn
  252.